/*
  ODAZone.cpp - 
*/

#include "ODAZone.h"
#include "ODASensor.h"
#include "WProgram.h"

Zone::Zone() {
  _sensorsAdded = 0;
  _enabled = false;
}

void Zone::addSensor(int pin) {
  _sensors[_sensorsAdded++].init(pin);
}

boolean Zone::isAlarm() {
  for (int s = 0; s < _sensorsAdded; s++) {
    if (_sensors[s].getStatus() == LOW) {
      return true;
    }
  }
  
  return false;
}

void Zone::enable() {
  _enabled = true;
}

void Zone::disable() {
  _enabled = false;
}

boolean Zone::isEnabled() {
  return _enabled;
}